<?php
if(!defined('READY2BLUE'))
	exit;
?>
<?php include(template('header'));?>
<?php include(template('command'));?>
<div class="block">
	<table cellpadding="0" cellspacing="0" width="90%" class="center">
		<tr class="tableheader">
			<td width="20%"><?php echo L('Directories')?></td>
			<td><?php echo L('Directory size');?></td>
			<td width="20%"><?php echo L('Options')?></td>
		</tr>
		<tr>
			<td><a href="?command=chdir ..">..[<?php echo L('Parent directory');?>]</a></td>
			<td></td>
			<td></td>
		</tr>
		<tr>
			<td><a href="?command=chdir .">. [<?php echo L('Cwd');?>]</a></td>
			<td><a href="?command=dirsize ."><?php echo L('Check');?></a></td>
			<td><input type="button" class="optionbutton" onclick="zip('.')" value="<?php echo L('Zip')?>" /></td>
		</tr>
		<?
		foreach ($dirs as $dir)
		{
		?>
		<tr>
			<td><a href="?command=chdir <?php echo $dir['dirname']?>"><?php echo $dir['dirname']?></a></td>
			<td><a href="?command=dirsize <?php echo $dir['dirname']?>"><?php echo L('Check')?></a></td>
			<td>
				<input type="button" class="optionbutton" onclick="rename('<?php echo $dir['dirname']?>')" value="<?php echo L('Rename')?>" />
				<input type="button" class="optionbutton" onclick="copydir('<?php echo $dir['dirname']?>')" value="<?php echo L('Copy')?>" />
				<input type="button" class="optionbutton" onclick="rmdir('<?php echo $dir['dirname']?>')" value="<?php echo L('Delete')?>" />
				<input type="button" class="optionbutton" onclick="zip('<?php echo $dir['dirname']?>')" value="<?php echo L('Zip')?>" />
			</td>
		</tr>
		<?
		}
		?>
	</table>
</div>
<div class="block">
	<table cellpadding="0" cellspacing="0" width="90%" class="center">
		<tr class="tableheader">
			<td width="20%"><?php echo L('Files')?></td>
			<td><?php echo L('File size')?></td>
			<td><?php echo L('Change time')?></td>
			<td width="20%"><?php echo L('Options')?></td>
		</tr>
		<?
		foreach($files as $file)
		{
		?>
		<tr>
			<td><a href="?command=download <?php echo $file['filename']?>"><?php echo $file['filename']?></a></td>
			<td><?php echo $file['formatsize']?></td>
			<td><?php echo date('Y-m-d h:i:s',$file['ctime'])?></td>
			<td>
				<input type="button" class="optionbutton" onclick="rename('<?php echo $file['filename']?>')" value="<?php echo L('Rename')?>" />
				<input type="button" class="optionbutton" onclick="copy('<?php echo $file['filename']?>')" value="<?php echo L('Copy')?>" />
				<input type="button" class="optionbutton" onclick="unlink('<?php echo $file['filename']?>')" value="<?php echo L('Delete')?>" />
				<? if(FileTools::IsZip($file['filename'])){?>
				<input type="button" class="optionbutton" onclick="unzip('<?php echo $file['filename']?>')" value="<?php echo L('Unzip')?>" />
				<? }
				?>
			</td>
		</tr>
		<?
		}
		?>
	</table>
</div>
<?php include(template('footer'));?>

